Skip to content

Homework#34

Open
melanikot-mipt wants to merge 7 commits intoDafeCpp:mainfrom
melanikot-mipt:homework
Open

Homework#34
melanikot-mipt wants to merge 7 commits intoDafeCpp:mainfrom
melanikot-mipt:homework

Conversation

@melanikot-mipt
Copy link
Copy Markdown

No description provided.

@melanikot-mipt
Copy link
Copy Markdown
Author

Готовы задания 1, 2, 4, 5, 7

Comment thread task_01/src/get_terms.hpp Outdated

using namespace std;

pair<int, int> get_terms(vector<int> v, int S) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetTerms(const std::vector<int>& array, int sum) {...}

Comment thread task_01/src/get_terms.hpp Outdated
using namespace std;

pair<int, int> get_terms(vector<int> v, int S) {
int N = v.size();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n

Comment thread task_01/src/get_terms.hpp Outdated

int l{0}, r{N - 1};

int s;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cuurent_sum

Comment thread task_01/src/main.cpp Outdated
else
cout << result.first << " " << result.second << endl;
/*
python3 ./scripts/run_cases.py --tasks task_01
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

хорошо, но я бы перенес в начало файла (что бы при открытии не крутить вниз, в поисках этой строки)

Comment thread task_02/src/get_border_index.hpp Outdated

using namespace std;

int get_border_index(vector<int> v) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

то же что и в первой задаче

Comment thread task_02/src/test.cpp Outdated
ASSERT_EQ(get_border_index(v13), 0);
}

void f(int i, vector<int> v) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

название по понятнее)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай файл переименуем

Comment thread task_05/src/topology_sort.hpp Outdated
using namespace std;

vector<int> temperature_rise(vector<int> v1) {
vector<int> stack, v2(v1.size(), 0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай 1 строка - одно объявление

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge_sort.hpp

vector<int> v2_sorted = MergeSort(v2);

// Слияние
size_t ptr1 = 0, ptr2 = 0;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я бы сделал отдельной функцией, Merge код станет понятнее

@melanikot-mipt
Copy link
Copy Markdown
Author

Добавлены решения и тесты к задачам 3, 10, 12. Добавлены тесты к задаче 9. Исправлены замечания.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants